<?
if($_POST[action]=="resume_doupdate"||$_POST[action]=="resume_doinsert"){	
			$err = '';
			if ($_POST['re_jobsearchstatus'] == '0')
			{
				$err .= "Job search status must select one from the list<br>";
			}
			if($_POST['re_aliasname'] == ''){
			    $err .= "Alias name is required<br>";		
			}
			if ($_POST['re_fname'] == '')
			{
				$err .= "First name is required<br>";
			}
			if ($_POST[re_lname] == '')
			{
				$err .= "Last Name is required<br>";
			}
			if ($_POST[re_email] == '')
			{
				$err .= "Email address is required<br>";
			}elseif(!ereg("^[a-zA-Z0-9][a-zA-Z0-9_\.]+[a-zA-Z0-9]@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $_POST[re_email])){
				  $err .= "Invalid Email address<br />";
			}
			if ($_POST[re_address1] == '')
			{
				$err .= "Street Address 1 is required<br>";
			}
			if ($_POST[re_locity] == '')
			{
				$err .= "Location - City is required<br>";
			}
			if ($_POST[re_lostate] == '0')
			{
				$err .= "State must select one from the list<br>";
			}
			if ($_POST[re_locountry] == '0')
			{
				$err .= "Country must select one from the list<br>";
			}
			if ($_POST[re_phone1] == '')
			{
				$err .= "Primary Phone is required<br>";
			}
			if ($_POST[re_jobtype] == '0')
			{
				$err .= "Desired job type must select one from the list<br>";
			}
			if ($_POST[re_jobindustry] == '0')
			{
				$err .= "Desired job category/industry must select one from the list<br>";
			}
			if ($_POST[re_jobtitle] == '')
			{
				$err .= "Desired job title is required<br>";
			}
			if ($_POST[re_yearexp] == '0')
			{
				$err .= "Years of work experience must select one from the list<br>";
			}
			if ($_POST[re_edulevel] == '0')
			{
				$err .= "Highest education level must select one from the list<br>";
			}
			if ($_POST[re_mgmt] == '0')
			{
				$err .= "Years of people mgmt experience must select one from the list<br>";
			}
			if ($_POST[re_profit] == '0')
			{
				$err .= "Years of profit & loss responsibility must select one from the list<br>";
			}
			if ($_POST[re_spoken] == '')
			{
				$err .= "Spoken language(s) is required<br>";
			}
			
			
			if ($_POST[re_detail] == '')
			{
				$err .= "Resume detail is required<br>";
			}
			if ($_POST[re_prvemployer]==''&&$_SESSION[usertype]=='recruiter'){
				$err .= "Three Previous Employers is required.<br>";
			}
			if(!PhpCaptcha::Validate($_POST['imagecode'])){
				$err .= "Invalid Safe Code.  Please try again.";
			}
		    if($_FILES[uploadfile][name] != ''&&$_FILES[uploadfile][size]>50000){
				$err .= "Only accept image size less than 50KB.";
			}
		    if($err == '' ){
				 include("./insert_do/resumealias_upd.php");
			}
		  	else
			{
				$re_usertype = htmlspecialchars(trim($_POST[re_usertype]));
				$re_fname    = htmlspecialchars(trim($_POST[re_fname]));
				$re_lname    = htmlspecialchars(trim($_POST[re_lname]));
				$aliasid     = $_POST[aliasid];
				$aliasNum    = htmlspecialchars(trim($_POST[re_aliasname]));
				$re_email    = htmlspecialchars(trim($_POST[re_email]));
				$re_address1 = htmlspecialchars(trim($_POST[re_address1]));
				$re_address2 = htmlspecialchars(trim($_POST[re_address2]));
				$re_lostate  = htmlspecialchars(trim($_POST[re_lostate]));
				$re_locountry= htmlspecialchars(trim($_POST[re_locountry]));
				$re_locity   = htmlspecialchars(trim($_POST[re_locity]));
				$re_phone1   = htmlspecialchars(trim($_POST[re_phone1]));
				$re_phone2   = htmlspecialchars(trim($_POST[re_phone2]));
				$re_jobtype  = htmlspecialchars(trim($_POST[re_jobtype]));
				$re_jobindustry = htmlspecialchars(trim($_POST[re_jobindustry]));
				$re_jobtitle = htmlspecialchars(trim($_POST[re_jobtitle]));
				$re_yearexp  = htmlspecialchars(trim($_POST[re_yearexp]));
				$re_edulevel = htmlspecialchars(trim($_POST[re_edulevel]));
				$re_proflicense = htmlspecialchars(trim($_POST[re_proflicense]));
				$re_mgmt     = htmlspecialchars(trim($_POST[re_mgmt]));
				$re_profit   = htmlspecialchars(trim($_POST[re_profit]));
				$re_spoken   = htmlspecialchars(trim($_POST[re_spoken]));
				$re_prolang  = htmlspecialchars(trim($_POST[re_prolang]));
				$re_ip = htmlspecialchars(trim($_POST[re_ip]));
				$re_ussecurity = htmlspecialchars(trim($_POST[re_ussecurity]));
				$re_authorize = htmlspecialchars(trim($_POST[re_authorize]));
				$re_detail   = trim($_POST[re_detail]);
				$re_comments = htmlspecialchars(trim($_POST[re_comments]));
				$re_currentpay = htmlspecialchars(trim($_POST[re_currentpay]));
				$re_desiredpay = htmlspecialchars(trim($_POST[re_desiredpay]));
				$re_jobsearchstatus = htmlspecialchars(trim($_POST[re_jobsearchstatus]));
				$re_benefits = htmlspecialchars(trim($_POST[re_benefits]));
				$re_schoolattend = htmlspecialchars(trim($_POST[re_schoolattend]));
				$re_describeme = htmlspecialchars(trim($_POST[re_describeme]));
				$re_favoriatebook = htmlspecialchars(trim($_POST[re_favoriatebook]));
				$re_highachieve = htmlspecialchars(trim($_POST[re_highachieve]));
				$re_iplan    = htmlspecialchars(trim($_POST[re_iplan]));
				$re_iliketo  = htmlspecialchars(trim($_POST[re_iliketo]));
				$re_personalweb= htmlspecialchars(trim($_POST[re_personalweb]));
				$re_prvemployer= htmlspecialchars(trim($_POST[re_prvemployer]));
				$re_prvempstatus= htmlspecialchars(trim($_POST[re_prvempstatus]));
				$re_professavilable= htmlspecialchars(trim($_POST[re_professavilable]));
				$re_private  = htmlspecialchars(trim($_POST[re_private]));
				$re_sponsorship = htmlspecialchars(trim($_POST[re_sponsorship]));
				$re_id = htmlspecialchars(trim($_POST[editid]));
				$actiontype  = $_POST[action];
				$statusForEdit = 1;
			}
}
?>